Conditions | 3 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { spawn, execSync } from 'child_process'; |
||
8 | async function main() { |
||
9 | const { platform, versions } = process; |
||
10 | |||
11 | console.log(JSON.stringify({ platform, versions })); |
||
|
|||
12 | // eslint-disable-next-line security/detect-non-literal-require |
||
13 | const packageJSON = require(path.join(process.cwd(), 'package.json')); |
||
14 | const config = packageJSON['node-package-tester']; |
||
15 | const testCommand = getTestCommand(config, { platform, versions }); |
||
16 | const prepareCommands = getPrepareCommands(config, { platform, versions }); |
||
17 | |||
18 | for (const prepareCommand of prepareCommands) { |
||
19 | execSync(prepareCommand); |
||
20 | } |
||
21 | |||
22 | const childProcess = spawn('npm', [ 'run', testCommand ], { shell: true, stdio: 'inherit' }); |
||
23 | |||
24 | childProcess.on('exit', (code) => process.exit(code)); |
||
25 | } |
||
26 | |||
29 |